<template>
  <FormRender
    :form="form"
    :schema="schema"
    :on-finish="onFinish"
  />
</template>

<script>
// import FormRender, { useForm } from 'form-render';

export default {
  // components: { FormRender },
  data() {
    return {
      form: useForm(),
      schema: {
        type: 'object',
        properties: {
          input1: {
            title: '简单输入框',
            type: 'string',
            required: true,
          },
          select1: {
            title: '单选',
            type: 'string',
            enum: ['a', 'b', 'c'],
            enumNames: ['早', '中', '晚'],
          },
        },
      }
    }
  },
  methods: {
    onFinish(formData, errors) {
      console.log('formData:', formData, 'errors', errors);
    }
  }
}
</script>

<style scoped>

</style>